﻿/// <reference path="Controls/BaseComplexControl.js" />
/// <reference path="../General/SizePos.js" />

var $DelayedLoadPanel = TA.Turbo.Controls.DelayedLoadPanel = function DelayedLoadPanel(clientId)
{
	this.BaseComplexControl(clientId);
}
$DelayedLoadPanel.Inherit(TA.Turbo.Controls.BaseComplexControl);

var _____a;
if (_____a)
{
	$DelayedLoadPanel.prototype = new TA.Turbo.Controls.BaseComplexControl();
	$DelayedLoadPanel.prototype.BaseComplexControl = new TA.Turbo.Controls.BaseComplexControl();
}

$DelayedLoadPanel.prototype._loading = false;

$PropertyDefinition.Define($DelayedLoadPanel, "Displayed", "D", false);

$DelayedLoadPanel.DefineEvent(new $ServerEvent("Display"));
$DelayedLoadPanel.DefineEvent(new $ClientEvent("DisplayComplete"));

$DelayedLoadPanel.prototype.Load = function Load()
{
	this.BaseComplexControl.Load.call(this);

	if (this.get_Displayed())
	{
		this.RaiseEvent("DisplayComplete", null);
	}
}

$DelayedLoadPanel.prototype.Display = function Display()
{
	if (!this.get_Displayed() && !this._loading)
	{
		this.RaiseServerEvent("Display", null, null);
		this._loading = true;
	}
}
